#pragma once

#include "DLL.h"
#include <MyViews/Tool.h>

namespace My {

class TransformEditor;

class DLL_API TransformTool : public Tool
{
	enum HitCode {
		htNone,
		htMove,
		htRotate,
		htCornerPin
	};

	struct HitInfo 
	{
		HitCode		code;
		int			index;
	};
public:
	TransformTool(TransformEditor & owner);
public:
	virtual void Deactivate(); 
	virtual void OnLButtonDown(UINT nFlags, CPoint p);
	virtual void OnLButtonUp(UINT nFlags, CPoint p);
	virtual void OnMouseMove(UINT nFlags, CPoint p);
	virtual bool OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
private:
	HitInfo GetHitInfo(CPoint p) const;
private:
	TransformEditor &	m_Editor;
	HitInfo				m_Hit;
};

} //namespace My
